﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="EditUserGroup.aspx.cs" Inherits="Cms.Web.UI.Admin.EditUserGroup" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript" src="Admin/Js/Edit.js"></script>
    <script language="javascript" type="text/javascript">
        //<![CDATA[
        function updatePanels(tab) {
            var pnlProperties = document.getElementById("ctl00_body_pnlProperties");
            var pnlFields = document.getElementById("ctl00_body_pnlFields");
            pnlProperties.style.display = "none";
            pnlFields.style.display = "none";
            switch (tab) {
                case "properties":
                    pnlProperties.style.display = "";
                    break;
                case "fields":
                    pnlFields.style.display = "";
                    break;
            }
        }

        var txtName;
        var originalName;

        function init() {
            txtName = document.getElementById("ctl00_body_txtName");
            originalName = txtName.value;
        }

        function isDirty() {
            var value = originalName == "" ||
	                    originalName != txtName.value;
            document.getElementById("ctl00_tabs_hidIsDirty").value = value;
            return value;
        }

	    //]]>
	</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="buttons" runat="server">
    <asp:UpdatePanel ID="upnlButtons" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <asp:LinkButton ID="lbSave" runat="server" OnClick="lbSave_Click" CssClass="orangeButton"><span id="lblSave1" runat="server"><span id="lblSave2" runat="server"><img src="Admin/Img/icons/disk.png" alt="" /><span><cms:LocalizedLiteral ID="llSave" runat="server" /></span></span></span></asp:LinkButton>
            <asp:HyperLink ID="hlCancel" runat="server" NavigateUrl="Admin/UserGroups.aspx" CssClass="orangeButton"><span><span><img src="Admin/Img/icons/delete.png" alt="" /><span><cms:LocalizedLiteral ID="llCancel" runat="server" /></span></span></span></asp:HyperLink>
            <asp:HyperLink ID="hlNewField" runat="server" CssClass="orangeButton"><span id="lblNewMenu1" runat="server"><span id="lblNewMenu2" runat="server"><img id="imgNewMenu" runat="server" src="Admin/Img/icons/textfield_add.png" alt="" /><span id="lblNewMenu3" runat="server"><cms:LocalizedLiteral ID="llNewField" runat="server" /></span></span></span></asp:HyperLink>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="tabs" runat="server">
    <asp:UpdatePanel ID="upnlTabs" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <cms:AdminTabStrip ID="tabStrip" runat="server" SelectedValue="properties" OnChange="tabStrip_Click">
                <cms:AdminTabItem ID="tiProperties" runat="server" value="properties" EnabledImage="Admin/Img/icons/group_gear.png"><cms:LocalizedLiteral ID="llPropertiesTab" runat="server" /></cms:AdminTabItem>
                <cms:AdminTabItem ID="tiFields" runat="server" value="fields" EnabledImage="Admin/Img/icons/textfield.png"><cms:LocalizedLiteral ID="llFieldsTab" runat="server" /></cms:AdminTabItem>
            </cms:AdminTabStrip>
            <input type="hidden" id="hidIsDirty" runat="server" />
            <input type="hidden" id="hidSave" runat="server" />
            <input type="hidden" id="hidUserGroupID" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="body" runat="server">
    <asp:Literal ID="litIcon" runat="server" Visible="false" Text="Admin/Img/Icons/group_edit.png" />

    <asp:Panel ID="pnlProperties" runat="server" CssClass="pnlTab">
        <asp:UpdatePanel ID="upnlProperties" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <table class="editForm">
                    <tr>
                        <td><cms:LocalizedLiteral ID="llName" runat="server" />:</td>
                        <td><asp:TextBox ID="txtName" runat="server" /></td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llLoginPage" runat="server" />:</td>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0"> 
                                <tr>
                                    <td><ilib:iDropDownList ID="ddlLoginFolders" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlLoginFolders_Changed" /></td>
                                    <td>
                                        <asp:DropDownList ID="ddlLoginPages" runat="server" />
                                        <asp:Label ID="lblNoLoginPages" runat="server"><cms:LocalizedLiteral ID="llNoLoginPages" runat="server" /></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td><cms:LocalizedLiteral ID="llStartPage" runat="server" />:</td>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0"> 
                                <tr>
                                    <td><ilib:iDropDownList ID="ddlStartFolders" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlStartFolders_Changed" /></td>
                                    <td>
                                        <asp:DropDownList ID="ddlStartPages" runat="server" />
                                        <asp:Label ID="lblNoStartPages" runat="server"><cms:LocalizedLiteral ID="llNoStartPages" runat="server" /></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="pnlTabOverlay"></div>
    </asp:Panel>

    <asp:Panel ID="pnlFields" runat="server" CssClass="pnlTab">
        <asp:UpdatePanel ID="upnlFields" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                Fields
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="pnlTabOverlay"></div>
    </asp:Panel>

    <script language="javascript">
        //<![CDATA[
        iLib.Dom.AddListener(window, "load", init);
        cms.Ajax.Init();
        cms.Ajax.AddEndRequestHandler(cms.Edit.HideTabOverlays);
        //]]>
    </script>
</asp:Content>
